@extends('default.layouts.adminPublic')
@section('title', '分类管理列表')

@section('content')
        <!--导航开始-->
<div class="crumb_warp">
    <i class="fa fa-home"></i> <a href="{{url('admin/coll_option')}}">首页</a> &raquo; 分类管理
</div>
<!--导航结束-->
<!--结果集标题与导航组件 开始-->

<div class="con">
    <div class="manage">
        @include('flash::message')
    </div>
    <div class="conMain">
        <div class="result_wrap">
            <div class="cTitle">分类管理列表</div>
            <div class="cContent">
                <span><a href="{{url('admin/coll_category/create')}}"><i class="fa fa-plus"></i>添加分类管理</a></span>
                <span><a href="{{url('admin/coll_category')}}"><i class="fa fa-recycle"></i>分类管理列表</a></span>
            </div>
        </div>
        <div class="conInfo">
            <div class="conList">
                <dl class="one">
                    <dt>分类名称</dt>
                    <dd>分类标识</dd>
                    <dd>分类操作</dd>
                </dl>
                @if(count($collCategory)>0)
                    @foreach($collCategory as $v)
                        <dl>
                            <dt>{{$v->cate_name}}</dt>
                            <dd>{{$v->sign}}</dd>
                            <dd>
                                <a href="{{url('admin/coll_category/'.$v->id.'/edit')}}">编辑</a>
                                <a onclick="delCate(this,'{{$v->id}}')">删除</a>
                            </dd>
                        </dl>
                    @endforeach
                @endif
            </div>

            <div class="page_list" style="width: 100%; margin-top: 15px; float: left">
                {!! $collCategory->links() !!}
            </div>

        </div>

        <div class="stopper" style="margin-top:10px; border-top: 1px solid #e5e5e5"></div>
    </div>
</div>
<!--结果集标题与导航组件 结束-->
@endsection

@section('footerjs')
    @parent
    <script>
        //删除权限
        function delCate(othis,cate_id) {
            layer.confirm('您确定要删除这个分类吗？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                $.post("{{url('admin/coll_category/')}}/" + cate_id, {
                    '_method': 'delete',
                    '_token': "{{csrf_token()}}"
                }, function (data) {
                    if (data.status == 0) {
                        $(othis).parents('dl').remove();
                        layer.msg(data.msg, {icon: 6});
                    } else {
                        layer.msg(data.msg, {icon: 5});
                    }
                });
            });
        }
    </script>
@endsection